// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// File:	scheduledproject.h
// Author: 	Kirk Larkin
// Date: 	25/09/2008
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#ifndef __SCHEDULEDPROJECT_H___
#define __SCHEDULEDPROJECT_H___

// Qt Includes
#include <QObject>
#include <QString>
#include <QTime>
#include <QDateTime>

// Local Includes
#include "../project.h"

// ******************************************************************
// ScheduledProject
// ******************************************************************
class ScheduledProject : public QObject
{
	Q_OBJECT

public:
// Construction & Destruction
	ScheduledProject(const QString &strProjectPath,
			const QTime &tmSchedule,
			QObject *pParent = NULL);

// Member Accessors
	const QString& getProjectPath() const { return m_strProjectPath; }

// Member Functions
	const QDateTime& updateSchedule(const QDateTime &dtLastRun = QDateTime());
	const QDateTime& getNextRunDateTime() const { return m_dtNextRun; }

public slots:
	void runProject();

signals:
	void projectComplete(Project::tProjectState eProjectState);

private slots:
	void onProjectStateChanged(Project::tProjectState eProjectState);

private:
// Member Variables
	QString m_strProjectPath;
	QTime m_tmSchedule;
	QDateTime m_dtLastRun, m_dtNextRun;
	Project *m_pProjectInstance;
};

#endif // __SCHEDULEDPROJECT_H___
